package com.ruoyi.food.serviceImpl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.food.mapper.TActivityMapper;
import com.ruoyi.food.object.TActivity;
import com.ruoyi.food.service.TActivityService;

@Service
public class TActivityServiceImpl implements TActivityService {

	@Autowired
	private TActivityMapper tActivityMapper;

	@Override
	public List<TActivity> findAllActivity(TActivity tAct) {
		// TODO Auto-generated method stub
		List<TActivity> tActivities=new ArrayList<>();
		tActivities=tActivityMapper.selectTActivity(tAct);
		for(TActivity tActivity:tActivities) {
			if(tActivity.getActId()==0) {
				tActivity.setNum(0);
			}
		}
		return tActivities;
	}

}
